import request from '@/utils/request'
import { USER_INFO } from '../actionsType'

export function getUserInfo () {
  async function fn (dispatch) {
    const res = await request({
      method: 'GET',
      url: 'user'
    })
    dispatch({ type: USER_INFO, payload: res.data })
  }
  return fn
}
